﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FishServe.Client.Shell.Interface;
using System.Windows.Forms;
using Microsoft.Practices.Unity;
using FishServe.Common.Services.Interface.Entities;
using FishServe.Core;
using FishServe.Client.CatchEffort.AddIn.Interface;

namespace FishServe.Client.Shell
{
    public class ShellModule : Module, IShellModule
    {
        private ShellForm _shellForm;
        private ICatchEffortAddIn _catchEffortAddIn;

        [Dependency]
        public IEntityBuilderService EntityBuilderService { get; set; }

        [Dependency]
        public ICatchEffortAddIn CatchEffortAddIn
        {
            get { return _catchEffortAddIn; }
            set { _catchEffortAddIn = value; }
        }

        [InjectionConstructor]
        public ShellModule([InjectChildContainer]IUnityContainer container) : base(container)
        {}

        public void Show()
        {
            _shellForm = new ShellForm();
            _shellForm.ShellModule = this;

            //ICatchEffortAddIn addIn = Container.Resolve<ICatchEffortAddIn>();
            //MessageBox.Show( "CatchEffortAddIn:" + addIn.GetText() );

            MessageBox.Show(_catchEffortAddIn.GetText());

            Application.Run(_shellForm);
        }
    }
}
